from django.conf import settings

from pacs.models import Problem,ProblemDescription

def _add_problem(description,input,output,testExamples):
	problem = Problem()
	problem.save()
	problemDescription = ProblemDescription(problem=problem,lang=settings.LANGUAGE_CODE[:2],description=description,
						input=input,output=output,testExamples=testExamples)
	problemDescription.save()

	import os
	os.makedirs(os.path.join(settings.TESTS_PATH,str(problem.id),"in"))
	os.makedirs(os.path.join(settings.TESTS_PATH,str(problem.id),"out"))
	os.makedirs(os.path.join(settings.TESTS_PATH,str(problem.id),"pout"))
	return problem
